SPECIAL3 011111 |
0 |
sa |
rt |
rd |
SHRA.QB 00100 |
SHLL.QB 010011 |
SPECIAL3 011111 |
0 |
sa |
rt |
rd |
SHRA_R.QB 00101 |
SHLL.QB 010011 |
6 |
2 |
3 |
5 |
5 |
5 |
6 |
SHRA[_R].QB |
Shift Right Arithmetic Vector of Four Bytes | |
SHRA.QB rd, rt, sa |
MIPSDSP-R2 |
Shift Right Arithmetic Vector of Four Bytes |
SHRA_R.QB rd, rt, sa |
MIPSDSP-R2 |
Shift Right Arithmetic Vector of Four Bytes |
Shift Right Arithmetic Vector of Four Bytes
To execute an arithmetic right shift on four independent bytes by a fixed number of bits.
rd = sign_extend(round(rt31..24 >> sa) || round(rt23..16 >> sa) || round(rt15..8 >> sa) || round(rt7..0 >> sa))
The four right-most byte elements in register rt are each shifted right arithmetically by sa bits, then written to the corresponding vector elements in destination register rd. The sa argument is interpreted as an unsigned three-bit integer taking values from zero to seven.
In the rounding variant of the instruction, a value of 1 is added at the most significant discarded bit position of each result prior to writing the rounded result to the destination register.
The sign of the left-most byte result is extended into the 32 most-significant bits of the destination register.
No data-dependent exceptions are possible.
The operands must be a value in the specified format. If they are not, the results are UNPREDICTABLE and the values of the operand vectors become UNPREDICTABLE.
SHRA.QB: tempD7..0 = ( GPR[rt]31)sa || GPR[rt]31..24+sa ) tempC7..0 = ( GPR[rt]23)sa || GPR[rt]23..16+sa ) tempB7..0 = ( GPR[rt]15)sa || GPR[rt]15..8+sa ) tempA7..0 = ( GPR[rt]7)sa || GPR[rt]7..sa ) GPR[rd]63..0 = (tempD7)32 || tempD7..0 || tempC7..0 || tempB7..0 || tempA7..0 SHRA_R.QB: if ( sa2..0 = 0 ) then tempD7..0 = GPR[rt]31..24 tempC7..0 = GPR[rt]23..16 tempB7..0 = GPR[rt]15..8 tempA7..0 = GPR[rt]7..0 else tempD8..0 = ( GPR[rt]31)sa || GPR[rt]31..24+sa-1 ) + 1 tempC8..0 = ( GPR[rt]23)sa || GPR[rt]23..16+sa-1 ) + 1 tempB8..0 = ( GPR[rt]15)sa || GPR[rt]15..8+sa-1 ) + 1 tempA8..0 = ( GPR[rt]7)sa || GPR[rt]7..sa-1 ) + 1 endif GPR[rd]63..0 = (tempD8)32 || tempD8..1 || tempC8..1 || tempB8..1 || tempA8..1
Reserved Instruction, DSP Disabled